#!../../jsrun

var n = 0;
var t0 = +new Date;

var f = function() {
	var id = getThreadId();
	//print("thread: " + id);
	if (++n > 50) {
		print("Execution time: " + (+new Date - t0) + " ms");
		return;
	}
	sleep(100)
	setTimeout(f, 0);
	print("****************************************************** thread " + id + " (" + getThreadId() + ") DONE");
	//GC();
};

setTimeout(f, 0);


while(true) sleep(10000);

